<template>
    <navigator url="../../pages/car/car" class="carView" >
        <image src="../../static/icon/gouwuche.png"></image>
        <text> ￥ {{money}}</text>
    </navigator>
</template>

<script>
    import until from "../until";
    export default {
        name: "car",
        props:['price'],
        data(){
            return{
                money:0,
            }
        },
        watch:{
            price(){
                this.money=parseInt(this.price);  //购物车金额
            }
        },
        created() {
            this.money=until.getMoneyNum(); //获取初始值
        }
    }
</script>

<style scoped>
    .carView{
        width: 5rem;
        height: 1.5rem;
        line-height: 1.6rem;
        border-bottom-right-radius: 1.25rem;
        border-top-right-radius: 1.25rem;
        margin-top: 1rem;
        padding: 0.5rem 0.2rem;
        background-color: #17B357;
        color: #ffffff;
        font-size: 1rem;
        position: fixed;
        left: 0;
        top: 850rpx;
        display: flex;
    }
    .carView>image{
        width: 1.5rem;
        height: 1.5rem;
    }
</style>